﻿<%@ Page Title="Checkout" Theme="Mobile" Language="C#" MasterPageFile="~/ProductMaster.master" AutoEventWireup="true" CodeBehind="Checkout.aspx.cs" Inherits="MobileShop.Checkout" %>

<asp:Content ID="Content1" ContentPlaceHolderID="bodyContent" runat="server">
    <script type="text/javascript">
        function checkout(key, shippingcost) {
            document.getElementById("shipping_1").value = shippingcost;
            document.getElementById("return").value = document.getElementById("return").value + key;
            document.getElementById("address1").value = document.getElementById("<%= txtShipTo.ClientID %>").value;
            document.getElementById("first_name").value = document.getElementById("<%= txtName.ClientID %>").value;
            document.getElementById("<%= btnHidCheckOut.ClientID %>").click();
        }
    </script>
    <asp:Label style='margin:10px; display:inline-block' Font-Size="11px" ID="lblNoItems" runat="server" Visible="false">No item to purchase.</asp:Label>
    <div id='divShow' runat="server">
    <asp:Button ID="btnHidCheckOut" runat="server" Style="display: none" />
    <table style='margin: auto' cellspacing="2">
        <tr>
            <td>
                <label class='normal'>
                    Name</label>
                <label class='required'>
                    *</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:200px' ID='txtName' runat="server" class='tb7'></asp:TextBox>
                <asp:RequiredFieldValidator ValidationGroup="Save" ID="require1" runat="server" ControlToValidate="txtName"
                    Display="Dynamic" CssClass="requiredField" ErrorMessage="" Text=""></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <label class='normal'>
                    Email</label>
                <label class='required'>
                    *</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:200px' ID='txtEmail' runat="server" class='tb7'></asp:TextBox>
                <asp:RequiredFieldValidator ValidationGroup="Save" ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="txtEmail" Display="Dynamic" CssClass="requiredField" ErrorMessage=""
                    Text=""></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator Display="Dynamic" CssClass="requiredField" ID="regexEmailValid"
                    runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                    ControlToValidate="txtEmail" ErrorMessage="<br/>Invalid Email Format"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                <label class='normal'>
                    Company</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:200px' ID='txtCompany' runat="server" class='tb7'></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <label class='normal'>
                    Phone(Tel.)</label>
                <label class='required'>
                    *</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:200px' ID='txtPhone' runat="server" class='tb7'></asp:TextBox>
                <asp:RequiredFieldValidator ValidationGroup="Save" ID="RequiredFieldValidator3" runat="server"
                    ControlToValidate="txtPhone" Display="Dynamic" CssClass="requiredField" ErrorMessage=""
                    Text=""></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <label class='normal'>
                    Address</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:200px' ID='txtAddress' runat="server" class='tb7'></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <label class='normal'>
                    Ship To</label><label class='required'>
                    *</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:200px' ID='txtShipTo' runat="server" class='tb7'></asp:TextBox>
                <asp:RequiredFieldValidator ValidationGroup="Save" ID="RequiredFieldValidator2" runat="server"
                    ControlToValidate="txtShipTo" Display="Dynamic" CssClass="requiredField" ErrorMessage=""
                    Text=""></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <label class='normal'>
                    Voucher</label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox style='width:140px' ID='txtVoucherCode' runat="server" class='tb7'></asp:TextBox>
                <asp:Button ID="btnApply" runat="server" Text="Apply" OnClick="btnApply_OnClick" />
            </td>
        </tr>
        <tr>
            <td>
                <br /><br />
                <label style='width:130px; display:inline-block' class='normal'>Amount(GST Incl.): </label>
                <asp:Label Font-Size="12px" class='productprice' ID="lblItemAmount" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <label  class='normal' style='width:130px; display:inline-block'>Shipping Cost: </label>
                <asp:Label Font-Size="12px" class='productprice' ID="lblShippingCost" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <label style='width:130px; display:inline-block' class='normal'>Discount: </label>
                <asp:Label Font-Size="12px" class='productprice' ID="lblDiscount" runat="server" Text="$0"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <label style='width:130px; display:inline-block; font-weight:bold' class='normal'>Total Amount: </label>
                <asp:Label Font-Size="12px" class='productprice' ID="lblTotalAmt" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                <asp:Button id="btnCheckout" runat="server" OnClick="btnCheckout_OnClick"
                    ValidationGroup="Save" Text="Checkout Now" />
                <br />
                <br />
                <asp:Label ID="lblError" runat="server" class="required" Visible="false"></asp:Label>
                <asp:Label ID="lblNote" runat="server" class="note" Visible="false">Your order has been submitted successfully. Thank you for supporting us!</asp:Label>
            </td>
        </tr>
    </table>

    <input type='hidden' name="currency_code" value="AUD" />
    <input type='hidden' name="cmd" value="_cart" />
    <input type='hidden' name="upload" value="1" />
    <input type='hidden' name="business" value='<%= POSSystem.BLL.Utilities.GetConfigAppSetting("PayPalAccount") %>' />
    <input type='hidden' name='return' id='return'  value="<%= GetThankYouURL() %>" />
    <input type='hidden' name='cancel_return' value='http://www.afyo.com.au' />
    <input type='hidden' id='shipping_1' name='shipping_1' value='<%= POSSystem.BLL.SystemVariables.SysVars.ShippingCost.ToString() %>' />
    <input type='hidden' name='address1' id='address1' value='' />
    <input type='hidden' name='first_name' id='first_name' value='' />
    <asp:Literal ID="litItem" runat="server">
        
    </asp:Literal>
</div>
</asp:Content>
